<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/vue-router.js"></script>
</head>
<body>
<div id="app">
    <router-view></router-view>
</div>
<template id='myindex'>
    <div>
        <router-link to="/show" tag="button">新闻标题</router-link>
    </div>
</template>
<template id='mycom'>
    <div>
        新闻中心
    </div>
</template>
<script>

    const indexPage = {
        template: '#myindex'
    }
    const showPage = {
        template: '#mycom'
    }

    new Vue({
        el: '#app',
        router: new VueRouter({
            routes: [
                {
                    path: '/show',
                    component: showPage
                },
                {
                    path: '/',
                    component: indexPage
                }
            ]
        })
    })
</script>
</body>
</html>
